package com.changzhi.common.config;

import com.changzhi.common.constans.Constants;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description:
 * @author: 小落
 * @date: 2020年11月16日
 */
@Configuration
public class MqConfig {

	@Bean
	public Queue deadQueue() {
		return new Queue("dead.queue", true);
	}

	@Bean
	public DirectExchange deadDirectExchange() {
		return new DirectExchange("dead.direct.exchange", true, false);
	}

	@Bean
	public Binding deadDirectBinding() {
		return BindingBuilder
				.bind(deadQueue())
				.to(deadDirectExchange())
				.with("dead");
	}

	@Bean
	public Queue userGiftQueue(){
		return new Queue(Constants.USER_GIFT_QUEUE_NAME );
	}

	@Bean
	public Queue pkFinishQueue(){
		return new Queue(Constants.PK_FINISH_QUEUE );
	}

	@Bean
	public Queue orderSuccessQueue(){
		return new Queue(Constants.USER_GIFT_QUEUE );
	}

	@Bean
	public Queue userInviteQueue(){
		return new Queue(Constants.USER_INVITE_QUEUE );
	}
	@Bean
	public Queue bindMobileQueue(){
		return new Queue(Constants.BIND_MOBILE_QUEUE );
	}

	@Bean
	public Queue smsQueue(){
		return new Queue(Constants.SMS);
	}

	@Bean
	public Queue activityAwardQueue(){
		return new Queue(Constants.ACTIVITY_AWARD_QUEUE );
	}

	@Bean
	public Queue channelOnlineQueue(){
		return new Queue(Constants.ACTIVITY_CHANNEL_ONLINE_QUEUE );
	}

}
